package com.goldgov.synchronous.service;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;

import com.goldgov.utils.PropertyUtil;

/** 
 * @ClassName: LearnStatistics 
 * @Description: 流动党员统计
 * @author hanxiangyu
 * @date 2018年11月28日 下午4:26:06 
 */
public class FlowLearnSynchronous {
	private String lddylearnStatID;
	private String organizationId;//组织id;
	private String organizationName;//组织名称;
	private Date learnDate;//学习时间
	private String scopeCode;
	private String parentId;
	private String treePath;
	private Integer orderNum;
	private Integer headCount;//总人数
	private Integer partyMemberNum;//普通党员总人数
	private Integer flowMemberNum;//流动党员总人数
	private Integer totalTime;//总时长
	private Double averageTime;//平均学习时长
	
	private String userId;//党员id
	
	
	
	public String getLddylearnStatID() {
		return lddylearnStatID;
	}
	public void setLddylearnStatID(String lddylearnStatID) {
		this.lddylearnStatID = lddylearnStatID;
	}
	public String getOrganizationId() {
		return organizationId;
	}
	public void setOrganizationId(String organizationId) {
		this.organizationId = organizationId;
	}
	public String getOrganizationName() {
		return organizationName;
	}
	public void setOrganizationName(String organizationName) {
		this.organizationName = organizationName;
	}
	public Date getLearnDate() {
		return learnDate;
	}
	public void setLearnDate(Date learnDate) {
		this.learnDate = learnDate;
	}
	public String getScopeCode() {
		return scopeCode;
	}
	public void setScopeCode(String scopeCode) {
		this.scopeCode = scopeCode;
	}
	public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	public String getTreePath() {
		return treePath;
	}
	public void setTreePath(String treePath) {
		this.treePath = treePath;
	}
	public Integer getOrderNum() {
		return orderNum;
	}
	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}
	public Integer getHeadCount() {
		return headCount;
	}
	public void setHeadCount(Integer headCount) {
		this.headCount = headCount;
	}
	public Integer getPartyMemberNum() {
		if (PropertyUtil.objectNotEmpty(this.headCount) 
				&& PropertyUtil.objectNotEmpty(this.flowMemberNum)) {
			partyMemberNum = this.headCount - this.flowMemberNum;
		}else if(PropertyUtil.objectNotEmpty(this.headCount) 
				&& !PropertyUtil.objectNotEmpty(this.flowMemberNum)) {
			partyMemberNum = this.headCount;
		}else {
			partyMemberNum = 0;
		}
		return partyMemberNum;
	}
	public void setPartyMemberNum(Integer partyMemberNum) {
		this.partyMemberNum = partyMemberNum;
	}
	public Integer getFlowMemberNum() {
		return flowMemberNum;
	}
	public void setFlowMemberNum(Integer flowMemberNum) {
		this.flowMemberNum = flowMemberNum;
	}
	public Integer getTotalTime() {
		return totalTime;
	}
	public void setTotalTime(Integer totalTime) {
		this.totalTime = totalTime;
	}
	public Double getAverageTime() {
		if (PropertyUtil.objectNotEmpty(this.totalTime) 
				&& PropertyUtil.objectNotEmpty(this.headCount)) {
				BigDecimal bd = new BigDecimal((float) this.totalTime / this.headCount);
				averageTime = bd.setScale(2, RoundingMode.HALF_UP).doubleValue();
			}
		return averageTime;
	}
	public void setAverageTime(Double averageTime) {
		this.averageTime = averageTime;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	
}
